/*
CREDITS:
Beheaded Kamikaze - Croteam

Weapon Sprites - Inferno Interactive (Shadow Warrior Expansion, Ripped by Zero X. Diamond)
Kamikaze Sprites - Captain Toenail
Tornado Sprites - Raven Software (Heretic)

Sounds:
Up - Mashup. One part by Epic Games (UT2004)
Idle, Start, Loop, End, Click - ? (Not sure, but I give my bets for Gore: Ultimate Soldier by 4D Rulers?)
Boom - ? (No ducking idea, found it on friend's old hardware, heh.)
Air Throw - ?
Air End - EA (C&C Generals)

Special thanks to Zdoom IRC's dwellers for a little brainstorming, as that
helped me to spawn the new, atrocious firing mode for this thing!
*/

ACTOR Mutilator : Weapon 24523
{
   //$Category Weapons
   //$Title Mutilator
   //$Sprite NLMGX0
   Inventory.PickupSound "misc/w_pkup"
   Inventory.PickupMessage "You got the ''Mutilator'' Mark MMMMCLXXV explosive agitation cannon! This version is surely better than Mark MMMMCLXXIV! (6)"
   Obituary "%o got his ears exploded, thanks to $k's ''Mutilator''."
   Weapon.UpSound "Weapons/MutilatorUp"
   Weapon.SelectionOrder 3
   Weapon.AmmoGive 20
   Weapon.AmmoType "RawketAmmo"
   Weapon.AmmoUse 1
   Weapon.AmmoUse2 0
   Weapon.AmmoType2 "MutilatorCounter"
   Weapon.AmmoGive2 0
   Weapon.Kickback 30
   Weapon.SlotNumber 6
   Weapon.BobStyle InverseSmooth
   Weapon.BobSpeed 1.2
   Weapon.BobRangeY 0.6
   Weapon.BobRangeX 1.2
   Scale 0.65
   +NOAUTOFIRE
   +AMMO_OPTIONAL
   States
   {
   Spawn:
      NLMG X -1
      Stop
   NoAmmo:
       NLMG A 0
       Goto Ready
   Ready:
      NLMG B 0 A_PlaySound("weapons/MutilatorIdle",5,1.0,1)
      NLMG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
      Loop
   Deselect:
      NLMG A 0 A_TakeInventory("MutilatorTrigger",1)
      NLMG A 0 A_StopSound(6)
      NLMG A 0 A_StopSound(5)
      NLMG A 0 A_ZoomFactor(1)
      NLMG A 1 A_Lower
      NLMG A 0 A_Lower
      Loop
   Select:
      NLMG A 1 A_Raise
      Loop
   FireExploder:
	  NLMG A 0 A_JumpIfInventory("MutilatorCounter",1,"ExploBlast")
	  Goto Fire+5
   Fire:
      NLMG A 0 A_JumpIfInventory("MutilatorMode",2,"FireExploder")
      NLMG A 0 A_JumpIfInventory("MutilatorMode",1,"FireAirstream")
      NLMG A 0 A_JumpIfInventory("MutilatorTrigger",1,"ChargingStop")
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",1,"KamikazeBlast")
      NLMG A 0 A_JumpIfInventory("RawketAmmo",2,1)
      Goto NoAmmo
      NLMG B 5 A_PlaySound("Weapons/MutilatorStart",1)
      NLMG B 1 A_ZoomFactor(0.97)
      NLMG B 1 A_ZoomFactor(0.95)
      NLMG B 0 A_StopSound(5)
   Hold:
      NLMG A 0 A_JumpIfInventory("MutilatorTrigger",1,"ChargingStop")
      NLMG A 0 A_JumpIfInventory("MutilatorMode",2,"HoldExploder")
      NLMG A 0 A_JumpIfInventory("MutilatorMode",1,"HoldAirstream")
      NLMG B 0 A_PlaySound("weapons/MutilatorLoop",5,1.0,1)
      NLMG B 0 A_PlaySound("weapons/MutilatorALoop",6,0.7,1)
      
      NLMG B 0 A_JumpIfNoAmmo("Endo")
      NLMG B 0 A_Recoil(1)
      NLMG B 0 A_SetPitch(pitch-1)
      NLMG B 1 Offset(8,40) A_FireCustomMissile("Kamikazenado",0.1*random(40,-40),1,10,-5,0,0.1*random(20,-20))
      NLMG B 1 Offset(12,44) A_ZoomFactor(0.93)
      
      NLMG B 0 A_Recoil(1)
      NLMG B 0 A_SetPitch(pitch-1)
      NLMG B 1 Offset(16,48) A_FireCustomMissile("Kamikazenado",0.1*random(40,-40),0,10,-5,0,0.1*random(20,-20))
      NLMG B 1 Offset(12,44) A_ZoomFactor(0.94)

      NLMG B 0 A_JumpIfNoAmmo("Endo")
      NLMG B 0 A_Recoil(1)
      NLMG B 0 A_SetPitch(pitch-1)
      NLMG B 1 Offset(8,40) A_FireCustomMissile("Kamikazenado",0.1*random(40,-40),1,10,-5,0,0.1*random(20,-20))
      NLMG B 1 Offset(12,44) A_ZoomFactor(0.93)

      NLMG B 0 A_Recoil(1)
      NLMG B 0 A_SetPitch(pitch-1)
      NLMG B 1 Offset(16,48) A_FireCustomMissile("Kamikazenado",0.1*random(40,-40),0,10,-5,0,0.1*random(20,-20))
      NLMG B 1 Offset(12,44) A_ZoomFactor(0.94)
      
      NLMG A 0 A_Refire("Hold")
   Endo:
      NLMG A 1 Offset(8,40) A_ZoomFactor(0.95)
      NLMG A 1 Offset(5,37) A_ZoomFactor(0.96)
      NLMG A 1 Offset(4,36) A_ZoomFactor(0.97)
      NLMG A 1 Offset(3,35) A_ZoomFactor(0.98)
      NLMG A 1 Offset(2,34) A_ZoomFactor(0.99)
      NLMG A 1 Offset(1,33) A_ZoomFactor(0.995)
      NLMG A 1 Offset(0,32) A_ZoomFactor(1)
      NLMG A 0 A_StopSound(6)
      NLMG A 0 A_StopSound(5)
      NLMG A 0 A_PlayWeaponSound("weapons/MutilatorEnd")
      NLMG A 24 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
      NLMG A 0 A_PlaySound("Weapons/MutilatorIdle",5,1.0,1)
      NLMG A 8 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
      NLMG A 0 A_ReFire("Ready")
      Goto Ready
   HoldExploder:
      NLMG B 0 A_PlaySound("weapons/MutilatorLoop",5,1.0,1)
      NLMG B 0 A_PlaySound("weapons/MutilatorALoop",6,0.7,1)
      
      NLMG B 0 A_JumpIfNoAmmo("Endo")
      NLMG B 0 A_Recoil(1)
      NLMG B 0 A_SetPitch(pitch-1)
      NLMG B 1 Offset(8,40) A_FireCustomMissile("MutilatorBoom",0.1*random(40,-40),1,10,-5,0,0.1*random(20,-20))
      NLMG B 1 Offset(12,44) A_ZoomFactor(0.93)
      
      NLMG B 0 A_Recoil(1)
      NLMG B 0 A_SetPitch(pitch-1)
      NLMG B 1 Offset(16,48) A_FireCustomMissile("MutilatorBoom",0.1*random(40,-40),0,10,-5,0,0.1*random(20,-20))
      NLMG B 1 Offset(12,44) A_ZoomFactor(0.94)

      NLMG B 0 A_JumpIfNoAmmo("Endo")
      NLMG B 0 A_Recoil(1)
      NLMG B 0 A_SetPitch(pitch-1)
      NLMG B 1 Offset(8,40) A_FireCustomMissile("MutilatorBoom",0.1*random(40,-40),1,10,-5,0,0.1*random(20,-20))
      NLMG B 1 Offset(12,44) A_ZoomFactor(0.93)

      NLMG B 0 A_Recoil(1)
      NLMG B 0 A_SetPitch(pitch-1)
      NLMG B 1 Offset(16,48) A_FireCustomMissile("MutilatorBoom",0.1*random(40,-40),0,10,-5,0,0.1*random(20,-20))
      NLMG B 1 Offset(12,44) A_ZoomFactor(0.94)
      
      NLMG A 0 A_Refire("HoldExploder")
	  Goto Endo
   FireAirstream:
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",1,"Blast")
      NLMG B 5 A_PlaySound("Weapons/MutilatorStart",1)
      NLMG B 1 A_ZoomFactor(0.98)
      NLMG B 1 A_ZoomFactor(0.97)
      NLMG B 0 A_StopSound(5)
   HoldAirstream:
      NLMG A 0 A_JumpIfInventory("MutilatorTrigger",1,"ChargingStop")
      NLMG B 0 A_PlaySound("Weapons/MutilatorAirstream",5,1.0,1)
      
      NLMG B 0 A_Recoil(1)
      NLMG B 0 A_SetPitch(pitch-1)
      NLMG B 1 Offset(4,36) A_FireCustomMissile("MutilatorAirflector",0.1*random(40,-40),0,10,-5,0,0.1*random(20,-20))
      NLMG B 1 Offset(8,40) A_ZoomFactor(0.96)
      
      NLMG B 1 Offset(12,44) A_FireCustomMissile("MutilatorAirflector",0.1*random(40,-40),0,10,-5,0,0.1*random(20,-20))
      NLMG B 1 Offset(8,40) A_ZoomFactor(0.95)

      NLMG B 0 A_Recoil(1)
      NLMG B 0 A_SetPitch(pitch-1)
      NLMG B 1 Offset(4,36) A_FireCustomMissile("MutilatorAirflector",0.1*random(40,-40),0,10,-5,0,0.1*random(20,-20))
      NLMG B 1 Offset(8,40) A_ZoomFactor(0.96)

      NLMG B 1 Offset(12,44) A_FireCustomMissile("MutilatorAirflector",0.1*random(40,-40),0,10,-5,0,0.1*random(20,-20))
      NLMG B 1 Offset(8,40) A_ZoomFactor(0.95)
      
      NLMG A 0 A_Refire("Hold")
   Airendo:
      NLMG A 1 Offset(8,40) A_ZoomFactor(0.95)
      NLMG A 1 Offset(5,37) A_ZoomFactor(0.96)
      NLMG A 1 Offset(4,36) A_ZoomFactor(0.97)
      NLMG A 1 Offset(3,35) A_ZoomFactor(0.98)
      NLMG A 1 Offset(2,34) A_ZoomFactor(0.99)
      NLMG A 1 Offset(1,33) A_ZoomFactor(0.995)
      NLMG A 1 Offset(0,32) A_ZoomFactor(1)
      NLMG A 0 A_StopSound(6)
      NLMG A 0 A_StopSound(5)
      NLMG A 0 A_PlayWeaponSound("Weapons/MutilatorAirstreamEnd")
      NLMG A 12 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
      NLMG A 0 A_PlaySound("Weapons/MutilatorIdle",5,1.0,1)
      NLMG A 8 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
      NLMG A 0 A_ReFire("Ready")
      Goto Ready

   AltFire:
      NLMG A 0 A_GiveInventory("MutilatorTrigger",1)
      NLMG A 2 A_PlaySound("Weapons/MutilatorClick",5)
      NLMG A 0 A_PlaySound("Weapons/ErasusShellStart",6)
      NLMG BC 2
      NLMG B 0 A_ReFire("Charging")
      Goto Blast
   Charging:
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",6,"Blast")
      NLMG A 0 A_PlaySound("Weapons/ErasusShellLoop",6,1.0,1)
      NLMG A 0 A_GiveInventory("MutilatorCounter",1)
      ERAG A 0 A_Quake(5,11,0,6,none)
      NLMG C 1 Offset(2,34) A_WeaponReady(WRF_NOBOB|WRF_NOSECONDARY)
      NLMG C 1 Offset(0,32) A_WeaponReady(WRF_NOBOB|WRF_NOSECONDARY)
      NLMG C 1 Offset(1,31) A_WeaponReady(WRF_NOBOB|WRF_NOSECONDARY)
      NLMG C 1 Offset(-1,33) A_WeaponReady(WRF_NOBOB|WRF_NOSECONDARY)
      NLMG C 1 Offset(2,32) A_WeaponReady(WRF_NOBOB|WRF_NOSECONDARY)
      NLMG C 1 Offset(1,33) A_WeaponReady(WRF_NOBOB|WRF_NOSECONDARY)
      NLMG C 1 Offset(0,32) A_WeaponReady(WRF_NOBOB|WRF_NOSECONDARY)
      NLMG C 1 Offset(2,30) A_WeaponReady(WRF_NOBOB|WRF_NOSECONDARY)
      NLMG C 1 Offset(-2,34) A_WeaponReady(WRF_NOBOB|WRF_NOSECONDARY)
      NLMG C 1 Offset(0,32) A_WeaponReady(WRF_NOBOB|WRF_NOSECONDARY)
      NLMG C 1 Offset(0,30) A_WeaponReady(WRF_NOBOB|WRF_NOSECONDARY)
      NLMG A 0 A_ReFire("Charging")
      Goto Blast
   ChargingStop:
      NLMG A 0 A_PlaySound("Weapons/ErasusShellStop",6)
      NLMG A 0 A_TakeInventory("MutilatorTrigger",1)
      NLMG A 0 Offset(0,32)
      NLMG CBA 2
      NLMG A 8
      NLMG A 0 A_ClearReFire//("Fire")
      Goto Ready
   Blast:
      NLMG A 0 A_TakeInventory("MutilatorTrigger",1)
      NLMG A 0 Offset(0,32)
      NLMG A 0 A_StopSound(6) //A_PlaySoundEx("Weapons/ErasusShellStop","SoundSlot6")
      NLMG A 0 A_PlaySound("Weapons/MutilatorBlast",1,0.9)
      NLMG CCCC 1 A_SetPitch(pitch+6)
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",6,"6Blast")
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",5,"5Blast")
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",4,"4Blast")
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",3,"3Blast")
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",2,"2Blast")
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",1,"1Blast")
      Goto 0Blast
   0Blast:
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 ThrustThingZ(0, 50, 0, 1)
      NLMG A 0 A_Recoil(-10)
      Goto BlastAnim
   1Blast:
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 ThrustThingZ(0, 65, 0, 1)
      NLMG A 0 A_Recoil(-15)
      Goto BlastAnim
   2Blast:
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 ThrustThingZ(0, 80, 0, 1)
      NLMG A 0 A_Recoil(-20)
      Goto BlastAnim
   3Blast:
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 ThrustThingZ(0, 95, 0, 1)
      NLMG A 0 A_Recoil(-25)
      Goto BlastAnim
   4Blast:
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 ThrustThingZ(0, 110, 0, 1)
      NLMG A 0 A_Recoil(-30)
      Goto BlastAnim
   5Blast:
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 ThrustThingZ(0, 125, 0, 1)
      NLMG A 0 A_Recoil(-35)
      Goto BlastAnim
   6Blast:
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 ThrustThingZ(0, 140, 0, 1)
      NLMG A 0 A_Recoil(-40)
      Goto BlastAnim
   BlastAnim:
      NLMG C 0 A_FireCustomMissile("MutilatorAirblast",0,0,10,-5,0,0)
      NLMG C 1 Offset(8,40) A_SetPitch(pitch-5)
      NLMG C 0 A_FireCustomMissile("MutilatorAirblast",0,0,10,-5,0,0)
      NLMG C 1 Offset(12,44) A_SetPitch(pitch-5)
      NLMG C 0 A_FireCustomMissile("MutilatorAirblast",0,0,10,-5,0,0)
      NLMG B 1 Offset(16,48) A_SetPitch(pitch-5)
      NLMG C 0 A_FireCustomMissile("MutilatorAirblast",0,0,10,-5,0,0)
      NLMG B 1 Offset(12,44) A_SetPitch(pitch-5)
      NLMG C 0 A_FireCustomMissile("MutilatorAirblast",0,0,10,-5,0,0)
      NLMG A 1 Offset(8,40) A_ZoomFactor(0.95)
      NLMG C 0 A_FireCustomMissile("MutilatorAirblast",0,0,10,-5,0,0)
      NLMG A 1 Offset(5,37) A_ZoomFactor(0.96)
      NLMG C 0 A_FireCustomMissile("MutilatorAirblast",0,0,10,-5,0,0)
      NLMG A 1 Offset(4,36) A_ZoomFactor(0.97)
      NLMG C 0 A_FireCustomMissile("MutilatorAirblast",0,0,10,-5,0,0)
      NLMG A 1 Offset(3,35) A_ZoomFactor(0.98)
      NLMG C 0 A_FireCustomMissile("MutilatorAirblast",0,0,10,-5,0,0)
      NLMG A 1 Offset(2,34) A_ZoomFactor(0.99)
      NLMG C 0 A_FireCustomMissile("MutilatorAirblast",0,0,10,-5,0,0)
      NLMG A 1 Offset(1,33) A_ZoomFactor(0.995)
      NLMG A 1 Offset(0,32) A_ZoomFactor(1)
      NLMG A 0 A_StopSound(6)
      NLMG A 10
      Goto Ready

   KamikazeBlast:
      NLMG A 2 A_PlaySound("Weapons/MutilatorClick",5)
      NLMG B 2
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",6,"6KamikazeBlast")
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",5,"5KamikazeBlast")
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",4,"4KamikazeBlast")
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",3,"3KamikazeBlast")
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",2,"2KamikazeBlast")
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",1,"1KamikazeBlast")
      NLMG B 4
      NLMG A 1
      Goto Ready
   1KamikazeBlast:
      NLMG A 0 A_JumpIfInventory("RawketAmmo",2,1)
      Goto Blast
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 A_TakeInventory("RawketAmmo",2)
      NLMG AAAA 0 A_FireCustomMissile("Kamikazenado",0.1*random(50,-50),0,10,-5,0,0.1*random(30,-30))
      NLMG A 0 A_Recoil(6)
      NLMG A 0 A_PlaySound("weapons/MutilatorEnd")
      NLMG C 0 A_PlaySound("Weapons/MutilatorBoom",1,0.7)
      NLMG A 0 A_StopSound(5)
      Goto KamikazeBlastAnim+5
   2KamikazeBlast:
      NLMG A 0 A_JumpIfInventory("RawketAmmo",3,1)
      Goto Blast
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 A_TakeInventory("RawketAmmo",3)
      NLMG AAAAAAAA 0 A_FireCustomMissile("Kamikazenado",0.1*random(60,-60),0,10,-5,0,0.1*random(30,-30))
      NLMG A 0 A_Recoil(8)
      NLMG A 0 A_PlaySound("weapons/MutilatorEnd")
      NLMG C 0 A_PlaySound("Weapons/MutilatorBoom",1,0.7)
      NLMG A 0 A_StopSound(5)
      Goto KamikazeBlastAnim+4
   3KamikazeBlast:
      NLMG A 0 A_JumpIfInventory("RawketAmmo",4,1)
      Goto Blast
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 A_TakeInventory("RawketAmmo",4)
      NLMG AAAAAAAAAAAA 0 A_FireCustomMissile("Kamikazenado",0.1*random(70,-70),0,10,-5,0,0.1*random(40,-40))
      NLMG A 0 A_Recoil(11)
      NLMG A 0 A_PlaySound("weapons/MutilatorEnd")
      NLMG C 0 A_PlaySound("Weapons/MutilatorBoom",1,0.7)
      NLMG A 0 A_StopSound(5)
      Goto KamikazeBlastAnim+3
   4KamikazeBlast:
      NLMG A 0 A_JumpIfInventory("RawketAmmo",5,1)
      Goto Blast
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 A_TakeInventory("RawketAmmo",5)
      NLMG AAAAAAAAAAAAAA 0 A_FireCustomMissile("Kamikazenado",0.1*random(80,-80),0,10,-5,0,0.1*random(40,-40))
      NLMG A 0 A_Recoil(14)
      NLMG A 0 A_PlaySound("weapons/MutilatorEnd")
      NLMG C 0 A_PlaySound("Weapons/MutilatorBoom",1,0.7)
      NLMG A 0 A_StopSound(5)
      Goto KamikazeBlastAnim+2
   5KamikazeBlast:
      NLMG A 0 A_JumpIfInventory("RawketAmmo",6,1)
      Goto Blast
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 A_TakeInventory("RawketAmmo",6)
      NLMG AAAAAAAAAAAAAAAAAAAA 0 A_FireCustomMissile("Kamikazenado",0.1*random(90,-90),0,10,-5,0,0.1*random(50,-50))
      NLMG A 0 A_Recoil(17)
      NLMG A 0 A_PlaySound("weapons/MutilatorEnd")
      NLMG C 0 A_PlaySound("Weapons/MutilatorBoom",1,0.7)
      NLMG A 0 A_StopSound(5)
      Goto KamikazeBlastAnim+1
   6KamikazeBlast:
      NLMG A 0 A_JumpIfInventory("RawketAmmo",7,1)
      Goto Blast
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 A_TakeInventory("RawketAmmo",7)
      NLMG AAAAAAAAAAAAAAAAAAAAAA 0 A_FireCustomMissile("Kamikazenado",0.1*random(100,-100),0,10,-5,0,0.1*random(50,-50))
      NLMG A 0 A_Recoil(20)
      NLMG A 0 A_PlaySound("weapons/MutilatorEnd")
      NLMG C 0 A_PlaySound("Weapons/MutilatorBoom",1,0.7)
      NLMG A 0 A_StopSound(5)
      Goto KamikazeBlastAnim
   KamikazeBlastAnim:
      NLMG B 1 Offset(8,40) A_SetPitch(pitch-6)
      NLMG B 1 Offset(12,44) A_SetPitch(pitch-6)
      NLMG B 1 Offset(16,48) A_SetPitch(pitch-6)
      NLMG B 1 Offset(12,44) A_SetPitch(pitch-6)
      NLMG B 1 Offset(8,40) A_ZoomFactor(0.95)
      NLMG B 1 Offset(5,37) A_ZoomFactor(0.96)
      NLMG B 1 Offset(4,36) A_ZoomFactor(0.97)
      NLMG A 1 Offset(3,35) A_ZoomFactor(0.98)
      NLMG A 1 Offset(2,34) A_ZoomFactor(0.99)
      NLMG A 1 Offset(1,33) A_ZoomFactor(0.995)
      NLMG A 1 Offset(0,32) A_ZoomFactor(1)
      NLMG A 24 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
      NLMG A 0 A_PlaySound("Weapons/MutilatorIdle",5,1.0,1)
      NLMG A 8 A_WeaponReady
      Goto Ready
	  
   ExploBlast:
      NLMG A 2 A_PlaySoundEx("Weapons/MutilatorClick","SoundSlot5")
      NLMG B 2
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",6,"6ExploBlast")
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",5,"5ExploBlast")
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",4,"4ExploBlast")
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",3,"3ExploBlast")
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",2,"2ExploBlast")
      NLMG A 0 A_JumpIfInventory("MutilatorCounter",1,"1ExploBlast")
      NLMG B 4
      NLMG A 1
      Goto Ready
   1ExploBlast:
      NLMG A 0 A_JumpIfInventory("RawketAmmo",2,1)
      Goto Blast
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 A_TakeInventory("RawketAmmo",2)
      NLMG AAAA 0 A_FireCustomMissile("MutilatorBoom",0.1*random(50,-50),0,10,-5,0,0.1*random(30,-30))
      NLMG A 0 A_Recoil(6)
      NLMG A 0 A_PlaySound("weapons/MutilatorEnd")
      NLMG C 0 A_PlaySound("Weapons/MutilatorBoom",1,0.7)
      NLMG A 0 A_StopSound(5)
      Goto SplosionBlastAnim+5
   2ExploBlast:
      NLMG A 0 A_JumpIfInventory("RawketAmmo",3,1)
      Goto Blast
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 A_TakeInventory("RawketAmmo",3)
      NLMG AAAAAA 0 A_FireCustomMissile("MutilatorBoom",0.1*random(60,-60),0,10,-5,0,0.1*random(30,-30))
      NLMG A 0 A_Recoil(8)
      NLMG A 0 A_PlaySound("weapons/MutilatorEnd")
      NLMG C 0 A_PlaySound("Weapons/MutilatorBoom",1,0.7)
      NLMG A 0 A_StopSound(5)
      Goto SplosionBlastAnim+4
   3ExploBlast:
      NLMG A 0 A_JumpIfInventory("RawketAmmo",4,1)
      Goto Blast
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 A_TakeInventory("RawketAmmo",4)
      NLMG AAAAAAAA 0 A_FireCustomMissile("MutilatorBoom",0.1*random(70,-70),0,10,-5,0,0.1*random(40,-40))
      NLMG A 0 A_Recoil(11)
      NLMG A 0 A_PlaySound("weapons/MutilatorEnd")
      NLMG C 0 A_PlaySound("Weapons/MutilatorBoom",1,0.7)
      NLMG A 0 A_StopSound(5)
      Goto SplosionBlastAnim+3
   4ExploBlast:
      NLMG A 0 A_JumpIfInventory("RawketAmmo",5,1)
      Goto Blast
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 A_TakeInventory("RawketAmmo",5)
      NLMG AAAAAAAAAA 0 A_FireCustomMissile("MutilatorBoom",0.1*random(80,-80),0,10,-5,0,0.1*random(40,-40))
      NLMG A 0 A_Recoil(14)
      NLMG A 0 A_PlaySound("weapons/MutilatorEnd")
      NLMG C 0 A_PlaySound("Weapons/MutilatorBoom",1,0.7)
      NLMG A 0 A_StopSound(5)
      Goto SplosionBlastAnim+2
   5ExploBlast:
      NLMG A 0 A_JumpIfInventory("RawketAmmo",6,1)
      Goto Blast
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 A_TakeInventory("RawketAmmo",6)
      NLMG AAAAAAAAAAAA 0 A_FireCustomMissile("MutilatorBoom",0.1*random(90,-90),0,10,-5,0,0.1*random(50,-50))
      NLMG A 0 A_Recoil(17)
      NLMG A 0 A_PlaySound("weapons/MutilatorEnd")
      NLMG C 0 A_PlaySound("Weapons/MutilatorBoom",1,0.7)
      NLMG A 0 A_StopSound(5)
      Goto SplosionBlastAnim+1
   6ExploBlast:
      NLMG A 0 A_JumpIfInventory("RawketAmmo",7,1)
      Goto Blast
      NLMG A 0 A_TakeInventory("MutilatorCounter",9)
      NLMG A 0 A_TakeInventory("RawketAmmo",7)
      NLMG AAAAAAAAAAAAAA 0 A_FireCustomMissile("MutilatorBoom",0.1*random(100,-100),0,10,-5,0,0.1*random(50,-50))
      NLMG A 0 A_Recoil(20)
      NLMG A 0 A_PlaySound("weapons/MutilatorEnd")
      NLMG C 0 A_PlaySound("Weapons/MutilatorBoom",1,0.7)
      NLMG A 0 A_StopSound(5)
      Goto SplosionBlastAnim
   SplosionBlastAnim:
      NLMG B 1 Offset(8,40) A_SetPitch(pitch-6)
      NLMG B 1 Offset(12,44) A_SetPitch(pitch-6)
      NLMG B 1 Offset(16,48) A_SetPitch(pitch-6)
      NLMG B 1 Offset(12,44) A_SetPitch(pitch-6)
      NLMG B 1 Offset(8,40) A_ZoomFactor(0.95)
      NLMG B 1 Offset(5,37) A_ZoomFactor(0.96)
      NLMG B 1 Offset(4,36) A_ZoomFactor(0.97)
      NLMG A 1 Offset(3,35) A_ZoomFactor(0.98)
      NLMG A 1 Offset(2,34) A_ZoomFactor(0.99)
      NLMG A 1 Offset(1,33) A_ZoomFactor(0.995)
      NLMG A 1 Offset(0,32) A_ZoomFactor(1)
      NLMG A 24 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
      NLMG A 0 A_PlaySoundEx("Weapons/MutilatorIdle","SoundSlot5",1)
      NLMG A 8 A_WeaponReady
      Goto Ready
   Reload:
      NLMG A 0 A_JumpIfInventory("MutilatorMode",2,"UnReload")
      NLMG A 0 A_JumpIfInventory("MutilatorMode",1,"MadeOfExplodium")
      NLMG A 0 A_Print("Airsoft Cuddly Towers Mode.")
      NLMG A 0 A_GiveInventory("MutilatorMode",1)
      Goto HNNNNNNG
   MadeOfExplodium:
      NLMG A 0 A_Print("Master Exploder Mode.")
      NLMG A 0 A_GiveInventory("MutilatorMode",1)
	  Goto HNNNNNNG
   UnReload:
      NLMG A 0 A_Print("Exploding Agitation Mode.")
      NLMG A 0 A_TakeInventory("MutilatorMode",2)
      Goto HNNNNNNG
   HNNNNNNG:
      NLMG A 0 A_PlaySound("Weapons/MutilatorClick",6)
      NLMG A 1 Offset(1,33) A_SetPitch(pitch+1)
      NLMG A 1 Offset(3,35) A_SetPitch(pitch+2)
      NLMG A 1 Offset(5,37) A_SetPitch(pitch+3)
      NLMG A 1 Offset(6,38) A_SetPitch(pitch+2)
      NLMG A 5 Offset(7,39)
      NLMG A 1 Offset(8,40) A_SetPitch(pitch-1)
      NLMG A 1 Offset(9,41) A_SetPitch(pitch-1)
      NLMG A 1 Offset(7,39) A_SetPitch(pitch-2)
      NLMG A 1 Offset(5,37) A_SetPitch(pitch-2)
      NLMG A 1 Offset(3,35) A_SetPitch(pitch-1)
      NLMG A 1 Offset(1,33) A_SetPitch(pitch-1)
      NLMG A 1 Offset(0,32)
      Goto Ready
   }
}

actor MutilatorCounter : Ammo
{
	Inventory.Amount 1
	Inventory.MaxAmount 6
	ammo.backpackamount 0
	ammo.backpackmaxamount 6
	Inventory.Icon "TNT1A0"
}

actor MutilatorTrigger : Ammo
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	ammo.backpackamount 0
	ammo.backpackmaxamount 1
}

actor MutilatorMode : Inventory
{
	Inventory.MaxAmount 2
}